package com.adams.custom.page.mgt.service;

import java.util.List;
import java.util.Map;

import net.sf.json.JSONObject;

import com.adams.core.exception.BusinessException;
import com.adams.custom.page.mgt.ViewTreeConfigDTO;

/**
 * 
 * File Name : ViewParseService.java
 * 
 * @Description : 界面服务接口
 */
public interface ViewParseService {

	/**
	 * Description : 根据菜单id获得界面显示窗口布局信息JSON串
	 * 
	 * @param userid
	 * @param menuid
	 * @return
	 * @throws BusinessException
	 * 
	 */
	public String getParseViewJSONByMenuId(long userid, long menuid)
			throws BusinessException;

	/**
	 * Description : 获得界面显示窗口布局信息
	 * 
	 * @param userid
	 * @param menuid
	 * @return
	 * @throws BusinessException
	 * 
	 */
	@SuppressWarnings("unchecked")
	public Map getParseViewByMenuId(long userid, long menuid)
			throws BusinessException;

	/**
	 * Description : 根据面板id获取面板布局信息JSON串 供查询条使用
	 * 
	 * @param userid
	 * @param menuid
	 * @param viewpanelid
	 * @return
	 * @throws BusinessException
	 * 
	 */
	public String getParseSearchItemsJSON(long userid, long menuid,
			String viewpanelidStr) throws BusinessException;

	/**
	 * Description : 根据面板id获取面板布局信息 供查询条使用
	 * 
	 * @param userid
	 * @param menuid
	 * @param viewpanelid
	 * @return
	 * @throws BusinessException
	 * 
	 */
	@SuppressWarnings("unchecked")
	public Map getParseSearchItems(long userid, long menuid,
			String viewpanelidStr, Map inputMap) throws BusinessException;

	/**
	 * Description : 获取数据表格头布局信息JSON串
	 * 
	 * @param userid
	 * @param gpanelId
	 * @return
	 * @throws BusinessException
	 * 
	 */
	public String getParseGridsJSON(long userid, String panelIdStr)
			throws BusinessException;
	
	/**
	 * Description : 获取数据表格头布局信息列表
	 * 
	 * @param userid
	 * @param gpanelId
	 * @return
	 * @throws BusinessException
	 * 
	 */
	public Map getParseGridsRightEvents(long userid, String panelIdStr)
	throws BusinessException;

	/**
	 * Description : 获取数据表格头布局信息
	 * 
	 * @param userid
	 * @param gpanelId
	 * @return
	 * @throws BusinessException
	 * 
	 */
	@SuppressWarnings("unchecked")
	public Map getParseGrids(long userid, String panelIdStr)
			throws BusinessException;

	/**
	 * Description : 获取数据表格数据布局信息
	 * 
	 * @param userid
	 * @param gpanelId
	 * @param whereSql
	 * @return
	 * @throws BusinessException
	 * 
	 */
	@SuppressWarnings("unchecked")
	public Map getParseGridDatas(long userid, String gpanelIdStr,
			String viewsearchidStr, Map inputMap) throws BusinessException;

	/**
	 * Description : 获取数据表格数据布局信息
	 * 
	 * @param userid
	 * @param gpanelId
	 * @param whereSql
	 * @return
	 * @throws BusinessException
	 * 
	 */
	@SuppressWarnings("unchecked")
	public Map getParseGridDatas(long userid, String gpanelIdStr,
			String viewsearchidStr, Map inputMap, boolean useCache)
			throws BusinessException;

	/**
	 * Description : 获取数据表格数据布局信息
	 * 
	 * @param userid
	 * @param viewpanelId
	 * @param dataList
	 * @return
	 * @throws BusinessException
	 * 
	 */
	@SuppressWarnings("unchecked")
	public Map getParseGridDatasFromList(long userid, String gpanelIdStr,
			List dataList, int total) throws BusinessException;

	/**
	 * Description : 解析列表得到动态选项信息
	 * 
	 * @param userid
	 * @param menuid
	 * @param dataList
	 * @return
	 * @throws BusinessException
	 * 
	 */
	@SuppressWarnings("unchecked")
	public Map getParseDynamicComboFromList(long userid, long menuid,
			List dataList) throws BusinessException;

	/**
	 * Description : 根据事件id解析界面显示
	 * 
	 * @param userid
	 * @param menuid
	 * @param viewtbarid
	 * @return
	 * @throws BusinessException
	 * 
	 */
	@SuppressWarnings("unchecked")
	public Map getParseViewByEventId(long userid, long menuid,
			String vieweventidStr, Map inputMap) throws BusinessException;

	/**
	 * Description : 根据内容项id解析界面显示
	 * 
	 * @param userid
	 * @param viewitemidStr
	 * @return
	 * @throws BusinessException
	 * 
	 */
	public String getParseViewJSONByItemId(long userid, String viewitemidStr)
			throws BusinessException;

	/**
	 * Description : 根据内容项id解析界面显示
	 * 
	 * @param userid
	 * @param viewitemidStr
	 * @return
	 * @throws BusinessException
	 * 
	 */
	@SuppressWarnings("unchecked")
	public Map getParseViewByItemId(long userid, String viewitemidStr)
			throws BusinessException;

	/**
	 * Description : 根据panelid获取操作面板详细信息JSON
	 * 
	 * @param userid
	 * @param viewpanelidStr
	 * @return
	 * @throws BusinessException
	 * 
	 */
	public String getParseOperatePanelDetailJSONByPanelid(long userid,
			String viewpanelidStr) throws BusinessException;

	/**
	 * Description : 根据panelid获取操作面板详细信息
	 * 
	 * @param userid
	 * @param viewpanelidStr
	 * @return
	 * @throws BusinessException
	 * 
	 */
	@SuppressWarnings("unchecked")
	public Map getParseOperatePanelDetailByPanelid(long userid,
			String viewpanelidStr) throws BusinessException;

	/**
	 * Description : 获取页面表单动态选项信息
	 * 
	 * @param userid
	 * @param menuid
	 * @param viewitemid
	 * @return
	 * @throws BusinessException
	 * 
	 */
	@SuppressWarnings("unchecked")
	public Map getParseDynamicCombo(long userid, long menuid,
			String viewitemidStr) throws BusinessException;

	/**
	 * Description : 支持界面输入动态增加或者修改数据
	 * 
	 * @param userid
	 * @param menuid
	 * @param viewformid
	 * @param inputMap
	 * @return
	 * @throws BusinessException
	 * 
	 */
	@SuppressWarnings("unchecked")
	public Map saveOrUpdateDataInViewForm(long userid, long menuid,
			String viewformidStr, Map inputMap) throws BusinessException;

	/**
	 * Description : 支持在列表中直接输入动态更新数据
	 * 
	 * @param userid
	 * @param menuid
	 * @param viewEventIdStr
	 * @param inputMaps
	 * @return
	 * @throws BusinessException
	 * 
	 */
	@SuppressWarnings("unchecked")
	public Map saveOrUpdateDataInGridPanel(long userid, long menuid,
			String viewEventIdStr, List<Map> inputMaps)
			throws BusinessException;

	/**
	 * 界面输入动态删除数据
	 * 
	 * @param tableCode
	 * @param list
	 */
	@SuppressWarnings("unchecked")
	public Map deleteDataByViewForm(long userId, String tbarId,
			List<Map> mapList) throws BusinessException;

	/**
	 * Description : 根据界面输入动态更新数据
	 * 
	 * @param userid
	 * @param menuid
	 * @param viewformid
	 * @param inputMap
	 * @return
	 * @throws BusinessException
	 * 
	 */
	@SuppressWarnings("unchecked")
	public Map getDataByViewForm(long userid, long menuid,
			String viewformidStr, Map inputMap) throws BusinessException;

	/**
	 * Description : 解析界面树配置信息 把数据转成界面树组件JSON串结构
	 * 
	 * 通用树结构数据转换 支持使用code的层次码树及使用parentid的顺序码 此设置在ViewTreeConfigDTO对象的codetype属性
	 * codetype=ViewTreeConfigDTO.CODETYPE_LEVELCODE 为层次码； 此时必须输入codeField编码字段
	 * codetype=ViewTreeConfigDTO.CODETYPE_PARENTID
	 * 为顺序码；此时必须输入parentidField父级id字段 displayField及idField都是必须要的
	 * 
	 * @param viewTreeConfigDTO
	 * @param datas
	 * @return
	 * @throws BusinessException
	 * 
	 */
	@SuppressWarnings("unchecked")
	public List<Map> getParseTreeData(ViewTreeConfigDTO viewTreeConfigDTO,
			List datas) throws BusinessException;

	/**
	 * Description : 根据表格panelid获取界面面板自定义过滤条件输入项信息
	 * 
	 * @param userid
	 * @param viewpanelidStr
	 * @return
	 * @throws BusinessException
	 * 
	 */
	public String getParseViewPanelFilterInputFormJsonByPanelid(long userid,
			String viewpanelidStr) throws BusinessException;

	/**
	 * Description : 缓存同步
	 * 
	 * @throws BusinessException
	 * 
	 */
	public void synchronizationCache() throws BusinessException;

	/**
	 * Description : 缓存清除
	 * 
	 * @throws BusinessException
	 * 
	 */
	public void clearCache();

	/**
	 * Description : 获取数据表格数据信息导出excle
	 * 
	 * @param userid
	 * @param eventID
	 * @param dataList
	 * @param total
	 * @return Excel数据记录列表
	 * @throws BusinessException
	 */
	public List getParseExcelDatas(long userid, String eventID,
			String viewsearchidStr, Map inputMap) throws BusinessException;

	/**
	 * Description : 获取数据表格数据信息导出excle
	 * 
	 * @param userid
	 * @param gpanelIdStr
	 * @param dataList
	 * @param total
	 * @param userCache
	 * @return Excel数据记录列表
	 * @throws BusinessException
	 */
	public List getParseExcelDatas(long userid, String gpanelIdStr,
			String viewsearchidStr, Map inputMap, boolean useCache)
			throws BusinessException;

	/**
	 * Description : 获取数据表格数据信息导出excle
	 * 
	 * @param userid
	 * @param gpanelIdStr
	 * @param dataList
	 * @return Excel数据记录列表
	 * @throws BusinessException
	 * 
	 */
	public List getParseExcelDatasFromList(long userid, String eventIdStr,
			List dataList) throws BusinessException;

	/**
	 * Description :上下移动排序
	 * 
	 * @param gridPanelId
	 * @param acitonType
	 * @param data
	 * @return 操作成功提示信息
	 * @throws Exception
	 */
	public Map Storting(String viewEventIdStr, JSONObject data)
			throws Exception;

	/**
	 * 
	 * Description 	: 根据 menuid 获取页面表单信息
	 *
	 * @param userid
	 * @param menuid
	 * @param inputMap
	 * @return
	 * @throws BusinessException
	 *
	 */
	public String getParseFormByMenuId(long userid, long menuid, Map inputMap)
			throws BusinessException;
}
